﻿using Core.MqModel;
//using EasyNetQ;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace MQ.Core.Admin.Extensions.Mq
{
    public class LogReceiver : BackgroundService
    {
        //private readonly IBus bus;
        //private readonly ILogger<LogReceiver> logger;
        //public LogReceiver(IBus bus, ILogger<LogReceiver> logger)
        //{
        //    this.bus=bus;
        //    this.logger = logger;
        //}
        protected override Task ExecuteAsync(CancellationToken stoppingToken)
        {
            //bus.Subscribe<Message>("my_id1", m => {
            //    logger.LogInformation($"index1:{m.Title}：{m.Content}：{m.Time.ToString()}");
            //});
            //bus.Subscribe<Message>("my_id2", m => {
            //    logger.LogInformation($"index2:{m.Title}：{m.Content}：{m.Time.ToString()}");
            //});
            return Task.CompletedTask;
        }
    }
}
